Skip to content

Comments

fix: ensure .env.local is added to .gitignore during install#69

Merged
nicknisi merged 2 commits intomainfrom
nicknisi/gitignore-creds
Feb 24, 2026
Merged

fix: ensure .env.local is added to .gitignore during install#69
nicknisi merged 2 commits intomainfrom
nicknisi/gitignore-creds

Conversation

@nicknisi
Copy link
Member

Summary

The AI installer writes secrets (API key, client ID, cookie password) to .env.local before the agent runs. If the user's project doesn't have .env.local in .gitignore, these secrets risk being committed and pushed to a remote repository.

This adds an ensureGitignore() step to env-writer.ts that runs automatically after writing .env.local:

  • Creates .gitignore with .env.local if no .gitignore exists
  • Appends .env.local to existing .gitignore if not already covered
  • No-ops if a covering pattern is already present (.env.local, .env*.local, .env*)
  • Preserves existing .gitignore content — append only, never rewrite

@nicknisi nicknisi force-pushed the nicknisi/gitignore-creds branch from 8c5d36c to 7c2d3e5 Compare February 24, 2026 22:44
@nicknisi nicknisi merged commit a21bfdc into main Feb 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants